USE [JaxDug]
GO

SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

IF EXISTS (SELECT [name] FROM sys.objects WHERE object_id = OBJECT_ID(N'dbo.InsertTag') AND TYPE IN (N'P', N'PC'))
BEGIN
	DROP PROC InsertTag
	PRINT 'DROP PROC InsertTag'
END
GO

-- ===============================================================
-- Author:		RbH
-- Create date: 2012.03.22
-- Description:	Inserts a new Tag into the database
-- Ussage:		EXEC InsertTag 'C#'
-- ===============================================================
CREATE PROCEDURE dbo.InsertTag
	@Tag NVARCHAR(50)
AS
BEGIN
	SET NOCOUNT ON;
	
	INSERT INTO dbo.Tags ( Tag )
	VALUES  ( @Tag )
END
GO

PRINT 'CREATE PROC InsertTag'

GRANT EXEC ON InsertTag TO PublicDbUser
GO

PRINT 'GRANT EXEC ON InsertTag TO PublicDbUser'